package com.yumeko.controller;

import com.yumeko.entity.TStorage;
import com.yumeko.service.TStorageService;
import com.yumeko.utils.ResponseData;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (TStorage)表控制层
 *
 * @author Zheng Hao
 * @since 2020-03-20 20:38:58
 */
@RestController
public class TStorageController {
    /**
     * 服务对象
     */
    @Resource
    private TStorageService tStorageService;

    @PostMapping(value = "storage/decrease")
    public ResponseData decrease(@RequestParam("productId") Long productId,
                                 @RequestParam("count") Integer count) {
        tStorageService.decrease(productId,count);
        return new ResponseData(200, "扣减库存成功");
    }
}